import java.util.HashMap;
import java.util.Map;

public class SolutionInterview1_4 {
    public boolean canPermutePalindrome(String s) {
        Map<Character,Integer> map=new HashMap<>();
        for (char c : s.toCharArray()) {
            map.put(c,map.getOrDefault(c,0)+1);
        }
        int ans=0;
        for (Map.Entry<Character, Integer> entry : map.entrySet()) {
            if (entry.getValue()%2==1){
                ans++;
            }
        }
        return ans<=1;
    }

    public static void main(String[] args) {
        System.out.println(new SolutionInterview1_4().canPermutePalindrome("tactcoa"));
    }
}
